home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Papers / From CodeWarrior to Delphi / TalkBASIC / Talking to STE < prev   
Encoding:
Text File  |  1997-02-22  |  837 b   |  27 lines  |  [TEXT/?BAS]

  1.  
  2. MsgBox("A demonstration of TalkBASIC controlling the Scriptable Text Editor")
  3. MsgBox("Make sure that the top doc in Scriptable Text Editor has at least three words")
  4.  
  5. Launch(quill)
  6. index = quill.Window(1).index
  7. name$ = quill.Window(1).name
  8. msgbox("Window 1, index = " + index + ", is named “" + name$ + "”")
  9.  
  10. wordnum = 1
  11. fontsize = quill.Window(1).Word(wordnum).Size
  12. msgbox("Word " + STR$(wordnum) + " font size = " + STR$(fontsize) )
  13.  
  14. wordnum = 2
  15. fontsize = quill.cwin_(1).cwor_(wordnum).ptsz_
  16. msgbox("Word " + STR$(wordnum) + " font size = " + STR$(fontsize) )
  17.  
  18. msgbox("We will now revise the text, font and size of word #3")
  19. quill.Window(1).Word(3).Size = 48
  20. quill.Window(1).Word(3).Contents = "TalkBASIC"
  21. quill.Window(1).Word(3).Font = "Times"
  22.  
  23. msgbox("End with a musical flourish!")
  24. note 1000,100,5
  25. note 1500,100,5
  26. note 2000,100,5
  27.